//
//  SYLocalConstantConfig.h
//  SYPerfectDemo
//
//  Created by Lssyyy on 2018/4/27.
//  Copyright © 2018年 Lssyyy. All rights reserved.
//

#ifndef SYLocalConstantConfig_h
#define SYLocalConstantConfig_h
//距离底部Margin
#define LL_BottomSpaceMargin (IS_GREATER_IPHONEX ? 34 : 15)
// Navibar height.
#define  LL_NaviBarHeight  ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 88.0 : 64.0)
// Bottom Status bar height.
#define  LL_BottomStatusBarHeight  ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 34.0 : 0.0)
//判断iPhoneX
#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isIPad : NO)

//判断iPHoneXr
#define IS_IPHONE_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !isIPad : NO)

//判断iPhoneXs
#define IS_IPHONE_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isIPad : NO)

//判断iPhoneXs Max
#define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !isIPad : NO)

//是否刘海屏机型
#define IS_GREATER_IPHONEX ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? YES : NO)
//判断是否是ipad
#define isIPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
//版本
#define iOS11Later ([UIDevice currentDevice].systemVersion.floatValue >= 11.0f)
#define iOS10Later ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)

#define UI_SCREEN_FRAME ([[UIScreen mainScreen] bounds])

#define UI_SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

#define UI_SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)

//---------------------判断--------------------------
//字符串是否为空
#define kStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length] < 1 ? YES : NO )
//数组是否为空
#define kArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count == 0)

//字典是否为空
#define kDictIsEmpty(dic) (dic == nil || [dic isKindOfClass:[NSNull class]] || dic.allKeys == 0)

//是否是空对象
#define kObjectIsEmpty(_object) (_object == nil \|| [_object isKindOfClass:[NSNull class]] \|| ([_object respondsToSelector:@selector(length)] && [(NSData *)_object length] == 0) \|| ([_object respondsToSelector:@selector(count)] && [(NSArray *)_object count] == 0))
// 是否为空对象
#define JMObjectIsNil(__object)  ((nil == __object) || [__object isKindOfClass:[NSNull class]])
//自定义存储中心
#define SYUserDefault [GVUserDefaults standardUserDefaults]

//本地化字符串
#define JMLocalStr(key) NSLocalizedString((key),(nil))

#define WeakSelf    @weakify(self)
#define StrongSelf  @strongify(self)
#endif /* SYLocalConstantConfig_h */
